@require "theme"

$articlePadding = $content-desktop-padding
$base-line-height = 1.8
$mb-line-height = 1.6

$code-block
  background: highlight-background
  margin: 0 0 20px 0
  padding: 12px 16px
  border-radius: 6px
  overflow: auto
  font-size 12px
  color: highlight-foreground
  line-height: $base-line-height
  border 1px solid highlight-border-color

  @media mq-mobile
    line-height $mb-line-height

$line-numbers
  color: #666

$line-code-theme
  color: color-text
  background-color: #fff
  border: 1px darken(color-background, 10%) solid
  font-size: 12px


.article
  blockquote
    border-left: 3px solid color-link;
    padding: 16px 20px;
    margin: 10px 0;
    background: color-background;
    line-height: $base-line-height

    p
      margin: 0;

  table
    width: 100%;
    border: 1px solid highlight-table-border-color;
    border-collapse: collapse;

    th
      background-color: rgba(229, 229, 229, 0.28);

    th, td
      border: 1px solid highlight-table-border-color;
      padding: .75rem;

    p
      margin 0
  pre, code
    font-family: font-mono
  code
    padding: 0.3em .5em;
    margin: 0 0.2em;
    @extend $line-code-theme
    border-radius: 2px
  pre
    @extend $code-block
    code
      background: none
      text-shadow: none
      padding: 0
  .highlight
    @extend $code-block
    pre
      border: none
      margin: 0
      padding: 0
    table
      margin: 0
      padding: 0
      border: 0
      width: auto
    td
      border: none
      padding: 0
    figcaption
      clearfix()
      font-size: 0.85em
      color: highlight-comment
      line-height: 1em
      margin-bottom: 1em
      a
        float: right
    .gutter {
      display none
    }
    .gutter pre
      @extend $line-numbers
      text-align: right
      padding-right: 20px
    .line
      line-height: $base-line-height
      font-size 12px

      @media mq-mobile
        line-height $mb-line-height
        font-size 12px
  .gist
    margin: 20px 0 //0 $articlePadding * -1
    border-style: solid
    border-color: $baseBorderColor
    border-width: 1px 0
    background: highlight-background
    padding: 15px article-padding 15px 15px
    .gist-file
      border: none
      font-family: $font-en
      margin: 0
      .gist-data
        background: none
        border: none
        .line-numbers
          @extend $line-numbers
          background: none
          border: none
          padding: 0 20px 0 0
        .line-data
          padding: 0 !important
      .highlight
        margin: 0
        padding: 0
        border: none
      .gist-meta
        background: highlight-background
        color: highlight-comment
        font: 13px $font-zh
        text-shadow: 0 0
        padding: 0
        margin-top: 1em
        margin-left: article-padding
        a
          color: color-link
          font-weight: normal
          &:hover
            text-decoration: underline

pre
  .comment
    color: highlight-comment
  .variable
  .attribute
  .tag
  .regexp
  .ruby .constant
  .xml .tag .title
  .xml .pi
  .xml .doctype
  .html .doctype
  .css .id
  .css .class
  .css .pseudo
    color: highlight-red
  .number
  .preprocessor
  .built_in
  .literal
  .params
  .constant
    color: highlight-orange
  .ruby .class .title
  .css .rules .attribute
    color: highlight-green
  .string
    color: highlight-blue
  .value
  .inheritance
  .header
  .ruby .symbol
  .xml .cdata
    color: highlight-green
  .title
    font-size 12px!important
    margin 0!important
  .title
  .css .hexcolor
    color: highlight-aqua
  .function
  .python .decorator
  .python .title
  .ruby .function .title
  .ruby .title .keyword
  .perl .sub
  .javascript .title
  .coffeescript .title
    color: highlight-blue
  .keyword
  .javascript .function
    color: highlight-green
